package main

import (
	"fmt"
	"io"
	"live_record_app/app/service/live"
	u "live_record_app/utils"
	"os"
	"time"

	"github.com/gin-gonic/gin"
)

var router *gin.Engine

func init() {
	// 设置时区为东八区
	var cstZone = time.FixedZone("CST", 8*3600) // 东八
	time.Local = cstZone
	gin.SetMode(gin.DebugMode)
}

func main() {
	system := u.CFile("logs", "system.log")
	gin.DefaultWriter = io.MultiWriter(os.Stdout, system)
	startServer()
}

func startServer() {
	router = gin.Default()
	// route.LoadApiRouter(router)
	var roomId, uid string
	fmt.Println("输入监听房间ID:")
	fmt.Scanf("%s", &roomId)
	fmt.Println("输入监听UID:")
	fmt.Scanf("%s", &uid)
	go live.ListenLiveRoom(roomId, uid)
	for {
	}
	// router.Run(":80")
}
